home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr28 / cron212.zip / CRON2.DOC < prev    next >
Text File  |  1993-05-27  |  16KB  |  355 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                                                       CRON/2
  9.  
  10.                                                          Client/server-based
  11.                                                      timed program execution
  12.                                                                       
  13.  
  14.                                                                  version 1.2
  15.                                                      
  16.                                                      
  17.                                                      
  18.                                                      
  19.                                                      
  20.                                                      
  21.                                                      
  22.                                                        A program by Bob Hood
  23.                                                  Copyright (C) 1993 Bob Hood
  24.  
  25.  
  26.  
  27.      CRON/2 is a copyrighted program.  You may use CRON/2 in any environment
  28.      for any purpose.  You may not sell CRON/2, nor charge a fee for CRON/2
  29.      except where a nomimal charge would be applicable for electronically
  30.      transferring CRON/2 any selected medium.
  31.  
  32.      Program and documentation copyright (C) 1993 Bob Hood.
  33.      All Rights Reserved.
  34.  
  35.  
  36.      OS/2 and products marked (TM) are trademarks or registered trademarks
  37.      of IBM Corporation
  38.  
  39.  
  40. CRON/2
  41. ---------------------------------------------------------------------------
  42.  
  43.      CRON/2 is another in a series of UNIX cron clones to the OS/2 platform.
  44.  
  45.      I didn't write CRON/2 to compete with any of the others; instead, I
  46.      wrote CRON/2 to give me more control over my applications than the
  47.      others.  I missed the ability to specify the launching of applications
  48.      to the degree afforded me by the UNIX version.  Most clones for OS/2
  49.      I've seen (and I'm sure I've not seen them all) were not as closely
  50.      modelled after the UNIX version as CRON/2.  However, you can judge
  51.      for yourself.
  52.  
  53.      CRON/2 adds a new (and perhaps worthless) twist in that it can be used
  54.      for networking timed launches between systems.  Utilizing TCP/IP, CRON/2
  55.      can act as a client, a server, or both in the same application by
  56.      allowing CRON/2 to launch applications on remote systems at a time of
  57.      its choosing.  This allows a central machine to control the running
  58.      of processes based upon factors that it alone is aware of (such as a
  59.      central file server initiating individual machine backups when network
  60.      load is minimal).
  61.  
  62.      If you like CRON/2, that's fantastic!  It's my first OS/2 application.
  63.      If you don't like CRON/2, that's fantastic too!  Go find (or write)
  64.      another that more closely suits your needs.
  65.      
  66.      I wrote CRON/2 to suit mine.
  67.  
  68.      WHO CAN USE CRON/2
  69.      ----------------------------------------------------------------------
  70.  
  71.      Anybody.  Anywhere.  Anytime.
  72.  
  73.      This is a FreeWare product.  The first of many of my contributions
  74.      back to IBM for making its development environment easily accessable
  75.      to developers.
  76.  
  77.      Thanks, Big Blue.  You still have a lot of suprises left for us...
  78.  
  79.      THE FUTURE
  80.      ----------------------------------------------------------------------
  81.  
  82.      I plan to develop a PM version of CRON/2 that supports drag-and-drop
  83.      and utilizes some container classes.  Other additions will likely only
  84.      be user-interface-related:  I like CRON/2's mechanics of specifying and
  85.      launching applications just the way it is.
  86.  
  87. USING CRON/2
  88. ---------------------------------------------------------------------------
  89.  
  90.      As I stated previously, I wrote CRON/2 for my own needs and
  91.      edification.  Because of this, you may find the documentation spartan
  92.      (and then again, you may not; what I consider "spartan" others consider
  93.      verbose).  I will, however, explain enough to use the application.
  94.  
  95.      STARTING CRON/2
  96.      ----------------------------------------------------------------------
  97.  
  98.      CRON/2 can be started with a number of command-line switches.  The
  99.      syntax appears as:
  100.  
  101.               CRON2 [[-n[s[0/1]]] [-s[0/1]] [-p<port>]] [-l[<logfile>]]
  102.  
  103.      Each option is explained below:
  104.  
  105.          -n          enables networking.  this option will cause CRON/2
  106.                      to initialize TCP/IP for use with entries in CRON2.DAT
  107.                      that specify a host name with braces ({}).  Not
  108.                      specifying this option when CRON2.DAT contains remote
  109.                      launches, or a missing TCP/IP installation on your
  110.                      machine, will cause CRON/2 to ignore those entries.
  111.  
  112.          -s          enables the built-in TCP/IP server.  this server runs
  113.                      as a separate thread within CRON/2, and is required
  114.                      to allow remote CRON/2 process to launch applications
  115.                      locally on your machine.
  116.  
  117.                      this parameter can be followed by an optional digit
  118.                      in the range 0 to 1.
  119.                      
  120.                      a value of 0 indicates that there will be no security
  121.                      for launching local processes initiated remotely.  Any
  122.                      application that a remote CRON/2 process requests will
  123.                      cause the local CRON/2 to attempt to launch it.
  124.  
  125.                      a value of 1 activates security on the local process.
  126.                      launch requests made by remote processes MUST appear
  127.                      identically in the local process's CRON2.DAT file, or
  128.                      the launch request will not be serviced.
  129.  
  130.                      as illustrated, this parameter can be attached to the
  131.                      "-n" option to enable both client and server portions
  132.                      of CRON/2 in the same process using separate threads.
  133.  
  134.          -p          specifies the TCP/IP port to use for initializing
  135.                      sockets.  this value defaults to port 10000 if not
  136.                      specified.
  137.  
  138.          -l          activates activity logging.  this options creates the
  139.                      file "CRON2.LOG" in the same drive/directory that
  140.                      CRON/2 was started from.
  141.  
  142.      DIRECTING CRON/2: THE CRON2.DAT FILE
  143.      ----------------------------------------------------------------------
  144.  
  145.      Unlike UNIX, CRON/2 uses a single command file for specifying
  146.      applications and launch times.  This file is called CRON2.DAT, and
  147.      MUST reside in the directory where the CRON/2 executable is started
  148.      from.  A sample CRON2.DAT file is provided in the distribution with
  149.      sample entries commented out.
  150.  
  151.      With few execptions, the CRON2.DAT file appears and behaves identically
  152.      to any UNIX cron files you may have worked with before:
  153.      
  154.              o Comments are denoted by a pound sign (#) in column one
  155.              o Command entries appear one to a line
  156.              o A virtually-unlimited number of entries may appear
  157.              o Each entry contains the usual cron fields:
  158.                      o minute
  159.                      o hour
  160.                      o day
  161.                      o month
  162.                      o day of the week
  163.                      o executable file and options
  164.  
  165.      Beyond these items, the CRON2.DAT file contains some OS/2-specific
  166.      entries necessary for controlling the types and appearance of
  167.      applications when they are launched.  Four additional fields appear
  168.      in each application record:
  169.  
  170.              o Application type: "VDM", "OS2", or "PM"
  171.              o Process priority: "FG" for foreground, "BG" for background)
  172.              o Appearance of application: "WIND" for windowed, "FULL" for
  173.                full screen
  174.  
  175.      The fourth field, not highlighted above, is optional, and preceeds
  176.      the path/executable entry in the CRON2.DAT file.  This field is
  177.      denoted by braces ({}), and specifies the name of a remote system
  178.      on which this application should be launched.
  179.                
  180.      Addtionally, each appearance token (WIND or FULL) may be followed by
  181.      a minus sign (-) to indicate that the application should be started
  182.      as a minimized icon.
  183.  
  184.      The following are example CRON/2 entries that I use to control my
  185.      USENET news feed from OS/2:
  186.  
  187.              0     1 * * * VDM BG WIND  c:\usenet\snews\expire.bat
  188.              25,55 * * * * VDM BG WIND  c:\usenet\snews\sendbtch.bat
  189.              0,30  * * * * OS2 BG FULL- c:\uucp_os2.cmd
  190.  
  191.      For those of you unfamiliar with cron, the first entry launches the
  192.      MS-DOS batch file "expire.bat" in the "c:\usenet\snews" directory
  193.      at 1:00 am each day.  It runs in a Virtual DOS Machine session, in the
  194.      background, in a PM window.
  195.  
  196.      The second entry is different only in that it runs the MS-DOS batch
  197.      file at 25 and 55 after *each* hour.
  198.  
  199.      The third entry operates on an OS/2-specific command file.  This
  200.      command file is initiated at the top of, and half past, each hour.
  201.      It is run in an OS/2 text session, in the background, in a full-screen
  202.      window that has is minimized to a Presentation Manager icon as soon
  203.      as it starts.
  204.  
  205.      You can specify multiple entries for minute, day, hour, month, and
  206.      day-of-the-week by separating them with commas.
  207.  
  208.      You can find addtional information about cron by consulting a UNIX
  209.      manual or man page.
  210.  
  211.      DYNAMIC SYNCHRONIZING
  212.      ----------------------------------------------------------------------
  213.  
  214.      To avoid having to stop and re-start CRON/2 when changes are made to 
  215.      CRON2.DAT, CRON/2 will check CRON2.DAT each minute to see if it has 
  216.      been changed since CRON/2 was started (or since the last time it 
  217.      processed CRON2.DAT).
  218.  
  219.      CRON/2 checks the size and date/time stamp of the CRON2.DAT file.  If 
  220.      the file has changed since CRON/2 started or the last synchronize, 
  221.      CRON/2 will release it's internal list of processes, and create a new 
  222.      list with the altered contents of CRON2.DAT.
  223.  
  224.      DIRECTING ANOTHER CRON/2: REMOTE TIMED LAUCHING
  225.      ----------------------------------------------------------------------
  226.  
  227.      CRON/2 has the ability to launch applications on other 
  228.      TCP/IP-networked OS/2 systems running another CRON/2 process with its 
  229.      TCP/IP server activated.
  230.  
  231.      To utilize this feature, you must have acquired and sucessfully 
  232.      installed IBM's TCP/IP 1.2 (TM) product on each system that you plan 
  233.      to run the CRON/2 server on.
  234.  
  235.      You specify this unique cron feature in two ways:  first, you must
  236.      activate CRON/2's TCP/IP support when it is started by one or a
  237.      combination of the -n or -s command-line paramaters; second, you
  238.      can optionally select entries in CRON2.DAT to launch on remote systems
  239.      by prefixing the executable name with the name of the remote system.
  240.  
  241.      Here is an example entry:
  242.  
  243.          11,38,42,59 * * * * PM  FG FULL {bhlocal1}c:\os2\apps\jigsaw.exe
  244.  
  245.      This entry in CRON2.DAT will launch the OS/2 PM Jigsaw application
  246.      in a full-screen Presentation Manager window as the foreground
  247.      application at 11, 38, 42, and 59 minutes after each hour.
  248.      
  249.      The difference in this entry is that it doesn't launch on the local
  250.      machine, but on the remote machine named "bhlocal1".  If you use
  251.      domain names to specify remote machines, the domain name must reside
  252.      in your TCPIP\ETC\hosts file.  You may also elect to specify remote
  253.      hosts in dotted-decimal format to avoid domain name resolving (i.e.,
  254.      {192.100.100.2} instead of {bhlocal1}).
  255.  
  256.      Needless to say, the application (and path) you specify for the remote
  257.      machine should actually exist.
  258.  
  259.      If security has been activated on the remote machine (i.e., -s1 or
  260.      -ns1), with the exception of the time/date/dow information, the
  261.      application entry fields in the local CRON2.DAT file must match
  262.      EXACTLY with those contained in the remote machine's CRON2.DAT file
  263.      for the application to be successfully launched remotely.
  264.  
  265.      The following examples illustrate a local and remote CRON2.DAT entry.
  266.      Each entry will fail remote execution (note that time/date/dow
  267.      information is not illustrated because is has no impact):
  268.  
  269.          PM  FG FULL {bhlocal1}c:\os2\apps\jigsaw.exe
  270.          PM  BG FULL {bhlocal1}c:\os2\apps\jigsaw.exe
  271.              --
  272.  
  273.          PM  FG FULL {bhlocal1}c:\os2\apps\jigsaw.exe
  274.          PM  FG FULL- {bhlocal1}c:\os2\apps\jigsaw.exe
  275.                 -----
  276.              
  277.          PM  FG FULL {bhlocal1}c:\os2\apps\jigsaw.exe
  278.          PM  FG FULL {bhlocal1}c:\os2\apps\jigsaw
  279.                                            ----------
  280.  
  281.      However, the next two entries WILL successfully compare because 
  282.      options are not taken into consideration (note that the illustrated 
  283.      options to Jigsaw are bogus):
  284.     
  285.          PM  FG FULL {bhlocal1}c:\os2\apps\jigsaw.exe
  286.          PM  FG FULL {bhlocal1}c:\os2\apps\jigsaw.exe -3 -new
  287.              
  288.      Formatting of fields is not important, so spaces and tabs between fields
  289.      in the CRON2.DAT will not be taken into consideration when security
  290.      is active.
  291.  
  292. GOTCHAS (non-bugs)
  293. ---------------------------------------------------------------------------
  294.  
  295.      o CRON/2 will barf if you specify either -ns1 or -s1 and there is
  296.        no local CRON2.DAT file...
  297.  
  298.      o Starting CRON/2 with an empty CRON2.DAT file will generate a
  299.        richly-deserved insult about your questionalble parentage...
  300.  
  301.      o System error messages detected by CRON/2 are displayed as decimal
  302.        only
  303.  
  304.      o If you are running any .CMD files from CRON2.DAT, you MUST have
  305.        COMSPEC set in your OS/2 environment (this is usually automatic)
  306.  
  307.      o You can't fool OS/2 into running a minimized process as the
  308.        foreground process...it knows you're only human...
  309.  
  310. WHAT THE ... ?! (known bugs)
  311. ---------------------------------------------------------------------------
  312.  
  313.      o Starting applications with the FG token, either locally or remotely,
  314.        will occasionally generate a 457 (ERROR_SMG_START_IN_BACKGROUND)
  315.        error...I don't know why yet...
  316.  
  317.      o CRON/2 was developed using a beta compiler on a beta platform...
  318.        so there...
  319.  
  320. YOU KNOW, IT'S FUNNY...
  321. ---------------------------------------------------------------------------
  322.  
  323.      It took me longer to come up with an icon for the damn thing than it
  324.      did to write it all...
  325.  
  326.  
  327. BUG REPORTS, QUESTIONS, COMMENTS, ATTA-BOYS...
  328. ---------------------------------------------------------------------------
  329.  
  330.                   Bob Hood
  331.      Mailnet    : 1217 S. Independence Street
  332.                   Lakewood, CO  80232
  333.  
  334.      Internet   : thor@arrakis.denver.co.us   <--- preferred!!
  335.      CIS        : 72672,3244
  336.      AT&Tnet    : (303) 980-8392
  337.  
  338. HISTORY
  339. ---------------------------------------------------------------------------
  340. 1.0            - Initial release
  341.  
  342. 1.1  05.19.93  - added activity logging
  343.                - added dynamic synchronizing of the CRON2.DAT file
  344.  
  345. 1.2  05.26.93  - corrected a bug introduced in 1.1 that suspended the update
  346.                  of the on-screen date/time
  347.                - corrected a problem with dynamic synchronizing that disabled
  348.                  the feature after the first process is launched
  349.                - re-designed logging mechanism to allow access to the log file
  350.                  with any file viewer/editor while CRON/2 is running
  351.                - added a mechanism to push log messages onto a FIFO queue when
  352.                  CRON/2 cannot access the log file
  353.                - removed the option to specify a different log file as a
  354.                  result of CRON/2 changing drive/paths
  355.